package com.woniuxy.intellihome.service.impl;

import com.woniuxy.intellihome.entity.Order;
import com.woniuxy.intellihome.entity.Orderitem;
import com.woniuxy.intellihome.mapper.OrderMapper;
import com.woniuxy.intellihome.service.OrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jobob
 * @since 2021-08-11
 */
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<Order> getByUserId(int userId) {
        return orderMapper.getByUserId(userId);
    }

    @Override
    public void add(Order order) {
        orderMapper.add(order);
    }

    @Override
    public Order getByOrderNum(String orderNum) {
        return orderMapper.getByOrderNum(orderNum);
    }
}
